Conditions | 1 |
Paths | 1 |
Total Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | const _ = require('lodash'); |
||
10 | |||
11 | before(() => { |
||
12 | _.set(global, 'chrome.runtime', { |
||
13 | onMessage: { |
||
14 | addListener: sinon.spy(), |
||
15 | }, |
||
16 | }); |
||
17 | |||
18 | runtime = global.chrome.runtime; |
||
19 | }); |
||
20 | |||
21 | describe('initialization', () => { |
||
22 | it('should bind to message events', () => { |
||
23 | const initialCallCount = runtime.onMessage.addListener.callCount; |
||
24 | |||
25 | // eslint-disable-next-line |
||
26 | require(path.join(projectRoot, 'source', 'js', 'events')); |
||
27 | |||
28 | expect(runtime.onMessage.addListener.callCount).to.be.greaterThan(initialCallCount); |
||
29 | }); |
||
30 | }); |
||
31 | }); |
||
32 |